package com.example.springbott.util;

import com.example.springbott.bean.common.CommonData;
import com.github.pagehelper.PageInfo;

public class CommonDataUtil {
    public static <T> CommonData CommonData(PageInfo<T> List){
        CommonData<T> CommonData = new CommonData<>();
        CommonData.setList(List.getList());
        CommonData.setTotal((int) List.getTotal());
        CommonData.setPages(List.getPages());
        CommonData.setPage(List.getPageNum());
        CommonData.setLimit(List.getPageSize());

        return CommonData;
    }

}
